package sc.prototype.pfs.eventnotify.model;

import java.util.Date;
import java.util.HashMap;

import sc.prototype.pfs.eventnotify.model.enums.NotifyStatus;

public class Notice {

    /** 通知Id */
    long noticeId;

    /** 关联通知配置 */
    NotifyConfig notifyConfig;

    /** 通知内容 */
    NoticeContent content;

    /** 通知目标 */
    NotifyTarget notifyTarget;

    /** 允许通知时间 */
    Date gmtAllowNotify;

    /** 已尝试通知次数 */
    int notifyCount;

    /** 通知状态 */
    NotifyStatus notifyStatus;

    /** 最近通知日志 */
    String lastNotifyLog;

    /** 扩展信息 */
    HashMap<String, String> extensions;

    /** 操作员 */
    String operator;

    /** 最近通知方 */
    String lastNotifier;

    /** 最近通知时间 */
    Date gmtLastNotify;

    /** 创建时间 */
    Date gmtCreate;

    public long getNoticeId() {
        return noticeId;
    }

    public void setNoticeId(long noticeId) {
        this.noticeId = noticeId;
    }

    public NotifyConfig getNotifyConfig() {
        return notifyConfig;
    }

    public void setNotifyConfig(NotifyConfig notifyConfig) {
        this.notifyConfig = notifyConfig;
    }

    public NoticeContent getContent() {
        return content;
    }

    public void setContent(NoticeContent content) {
        this.content = content;
    }

    public NotifyTarget getNotifyTarget() {
        return notifyTarget;
    }

    public void setNotifyTarget(NotifyTarget notifyTarget) {
        this.notifyTarget = notifyTarget;
    }

    public Date getGmtAllowNotify() {
        return gmtAllowNotify;
    }

    public void setGmtAllowNotify(Date gmtAllowNotify) {
        this.gmtAllowNotify = gmtAllowNotify;
    }

    public int getNotifyCount() {
        return notifyCount;
    }

    public void setNotifyCount(int notifyCount) {
        this.notifyCount = notifyCount;
    }

    public NotifyStatus getNotifyStatus() {
        return notifyStatus;
    }

    public void setNotifyStatus(NotifyStatus notifyStatus) {
        this.notifyStatus = notifyStatus;
    }

    public String getLastNotifyLog() {
        return lastNotifyLog;
    }

    public void setLastNotifyLog(String lastNotifyLog) {
        this.lastNotifyLog = lastNotifyLog;
    }

    public HashMap<String, String> getExtensions() {
        return extensions;
    }

    public void setExtensions(HashMap<String, String> extensions) {
        this.extensions = extensions;
    }

    public String getOperator() {
        return operator;
    }

    public void setOperator(String operator) {
        this.operator = operator;
    }

    public String getLastNotifier() {
        return lastNotifier;
    }

    public void setLastNotifier(String lastNotifier) {
        this.lastNotifier = lastNotifier;
    }

    public Date getGmtLastNotify() {
        return gmtLastNotify;
    }

    public void setGmtLastNotify(Date gmtLastNotify) {
        this.gmtLastNotify = gmtLastNotify;
    }

    public Date getGmtCreate() {
        return gmtCreate;
    }

    public void setGmtCreate(Date gmtCreate) {
        this.gmtCreate = gmtCreate;
    }

    public String toShortString() {
        return String.format("Notice-%d-%s", noticeId, notifyConfig != null ? notifyConfig.getConfigName() : "null");
    }

    @Override
    public String toString() {
        return "Notice [noticeId=" + noticeId + ", notifyConfig="
                + (notifyConfig != null ? notifyConfig.getConfigName() : "null") + ", content=" + content + ", target="
                + notifyTarget + ", gmtAllowNotify=" + gmtAllowNotify + ", notifyCount=" + notifyCount
                + ", notifyStatus=" + notifyStatus + ", lastNotifyLog=" + lastNotifyLog + ", extensions=" + extensions
                + ", operator=" + operator + ", lastNotifier=" + lastNotifier + ", gmtLastNotify=" + gmtLastNotify
                + ", gmtCreate=" + gmtCreate + "]";
    }

}
